Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-milestone is "x-send-event">

With this node you can send an event to the event server and trigger an Alarm with the possibility to activate a rule associated with it.

Inputs

A JSON with these parameters:

name string
The name of the event which will be send and trigger. The event must exist in the VMS. (mandatory)
guid string
The Guid associated with a hardware device in the Milestone VMS(e.g. Camera, Microphone). Device must be registered. (mandatory)
hostname string
The hostname where the Milestone VMS runs on. Only http or https are allowed(default localhost). (mandatory)
port number
The port that allows send analytics events to the VMS, which must be activated(default 9090). Check the XProtect documentation for more details. (mandatory)
Description string
A short description of the event which will be send. If it's generated from Snap4City will contain name, GPS position, severity, impact etc.. (optional)

Outputs

A JSON object with these parameters:

messagge string
The result of the send operation to VMS, with any error

Example of JSON output if the opreation is correct:

{
    message: "OK Event sent correctly"
}
        

Example of JSON output if operation goes wrong:

{
    message: "Connection error: TypeError[ERR_INVALID_URL]:Invalid URL:http://wrongaddress:9090"
}
        

Details

The node can receive the parameters described in the Inputs section, with them generates a XML file readable from the event server, and with server response generates the output JSON. If the values are not present in the input JSON, these are read by those in the node properties. If they are not present in either part or are wrong, an error is generated for the necessary parameters or the reason why are not correct.